package com.niit.schoolhub.system.controller;


import com.niit.schoolhub.system.mapper.YesapiOneArticleTagMapper;
import com.niit.schoolhub.system.pojo.YesapiOneArticleTag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * 轻量博客-文章标签 前端控制器
 * </p>
 *
 * @author kaguya
 * @since 2021-11-27
 */
@RestController
@CrossOrigin
@RequestMapping("/system/yesapiOneArticleTag")
public class YesapiOneArticleTagController {

    @Autowired
    private YesapiOneArticleTagMapper yesapiOneArticleTagMapper;
    @PostMapping("/set/ArticleTag")
    public int setArticleTag(@RequestBody YesapiOneArticleTag yesapiOneArticleTag){
        yesapiOneArticleTagMapper.insert(yesapiOneArticleTag);
        System.out.println(yesapiOneArticleTag);
        return 1;
    }

    @RequestMapping("/get/ArtilcleTag")
    public List<YesapiOneArticleTag> getArticleTag(){
        List<YesapiOneArticleTag> yesapiOneArticleTags = yesapiOneArticleTagMapper.selectList(null);
        return yesapiOneArticleTags;
    }
}

